﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Nhap_ChiTieuKinhTe.ascx.cs" Inherits="uicontrol_CT_KinhTe" %>
<asp:Label ID="Label1" runat="server" Text="NHẬP CÁC CHỈ TIÊU KINH TẾ" CssClass="LabelTitle"></asp:Label>
<br />
<br />
<table>
    <tr>
        <td >
            <asp:Label ID="Label2" runat="server" CssClass="Label" Text="Tên Hội đồng"></asp:Label></td>
        <td>
            <asp:DropDownList ID="ddlHD" runat="server" CssClass="DropdownList" DataSourceID="dsHD"
                DataTextField="TenHoiDong" DataValueField="MaHoiDong" OnSelectedIndexChanged="ddlHD_SelectedIndexChanged" AutoPostBack="True">
            </asp:DropDownList></td>
        <td>
        </td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label3" runat="server" CssClass="Label" Text="Tên Sản phẩm"></asp:Label></td>
        <td>
            <asp:DropDownList ID="ddlSP" runat="server" CssClass="DropdownList" DataSourceID="dsSP"
                DataTextField="TenSanPham" DataValueField="MaSanPham" OnSelectedIndexChanged="ddlSP_SelectedIndexChanged" AutoPostBack="True">
            </asp:DropDownList></td>
        <td>
        </td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label4" runat="server" CssClass="Label" Text="Giá trị tổng doanh thu (Q)"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtTDT" runat="server" CssClass="TextBox" MaxLength="50">0</asp:TextBox>
            <asp:Label ID="Label10" runat="server" CssClass="Label" Text="đồng"></asp:Label></td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Không được trống" ControlToValidate="txtTDT" CssClass="ValidateLabel" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtTDT"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Giá trị phải > 0" ValidationExpression="(^[0-9]*[1-9]+[0-9]*\.[0-9]*$)|(^[0-9]*\.[0-9]*[1-9]+[0-9]*$)|(^[0-9]*[1-9]+[0-9]*$)"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label5" runat="server" CssClass="Label" Text="Tổng số lao động (T)"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtTSLD" runat="server" CssClass="TextBox" MaxLength="10">0</asp:TextBox>
            <asp:Label ID="Label14" runat="server" CssClass="Label" Text="người"></asp:Label></td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtTSLD"
                CssClass="ValidateLabel" ErrorMessage="Không được trống" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtTSLD"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Giá trị phải nguyên và > 0"
                ValidationExpression="^[1-9]([0-9]?)([0-9]?)([0-9]?)([0-9]?)([0-9]?)([0-9]?)([0-9]?)([0-9]?)([0-9]?)$"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label6" runat="server" CssClass="Label" Text="Lợi nhuận (P)"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtLoiNhuan" runat="server" CssClass="TextBox" MaxLength="50">0</asp:TextBox>
            <asp:Label ID="Label11" runat="server" CssClass="Label" Text="đồng"></asp:Label></td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtLoiNhuan"
                CssClass="ValidateLabel" ErrorMessage="Không được trống" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtLoiNhuan"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Giá trị phải > 0" ValidationExpression="(^[0-9]*[1-9]+[0-9]*\.[0-9]*$)|(^[0-9]*\.[0-9]*[1-9]+[0-9]*$)|(^[0-9]*[1-9]+[0-9]*$)"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label7" runat="server" CssClass="Label" Text="Giá tài sản cố định còn lại (K2)"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtTSCD" runat="server" CssClass="TextBox" MaxLength="50">0</asp:TextBox>
            <asp:Label ID="Label12" runat="server" CssClass="Label" Text="đồng"></asp:Label></td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtTSCD"
                CssClass="ValidateLabel" ErrorMessage="Không được trống" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ControlToValidate="txtTSCD"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Giá trị phải > 0" ValidationExpression="(^[0-9]*[1-9]+[0-9]*\.[0-9]*$)|(^[0-9]*\.[0-9]*[1-9]+[0-9]*$)|(^[0-9]*[1-9]+[0-9]*$)"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label8" runat="server" CssClass="Label" Text="Giá trị gia tăng (Va)"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtGTGT" runat="server" CssClass="TextBox" MaxLength="50">0</asp:TextBox>
            <asp:Label ID="Label13" runat="server" CssClass="Label" Text="đồng"></asp:Label></td>
        <td>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtGTGT"
                CssClass="ValidateLabel" ErrorMessage="Không được trống" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ControlToValidate="txtGTGT"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Giá trị phải > 0" ValidationExpression="(^[0-9]*[1-9]+[0-9]*\.[0-9]*$)|(^[0-9]*\.[0-9]*[1-9]+[0-9]*$)|(^[0-9]*[1-9]+[0-9]*$)"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td >
            <asp:Label ID="Label9" runat="server" CssClass="Label" Text="Năm"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtNam" runat="server" CssClass="TextBox" MaxLength="4"></asp:TextBox></td>
        <td>
            <asp:RegularExpressionValidator ID="revNam" runat="server" ControlToValidate="txtNam"
                CssClass="ValidateLabel" Display="Dynamic" ErrorMessage="Năm không hợp lệ" ValidationExpression="([1][9][0-9][0-9])|([2][0-1][0-9][0-9])"></asp:RegularExpressionValidator></td>
    </tr>
    <tr>
        <td>
        </td>
        <td>
        </td>
        <td>
        </td>
    </tr>
    <tr>
        <td >
            </td>
        <td>
            <asp:Button ID="btnDongY" runat="server" CssClass="Button" Text="Đồng ý" OnClick="btnDongY_Click" />
            &nbsp; &nbsp;&nbsp;
            <asp:Button ID="btnCancel" runat="server" Text="Làm lại" CausesValidation="False" OnClick="btnCancel_Click" /></td>
        <td>
            </td>
    </tr>
</table>
<asp:SqlDataSource ID="dsHD" runat="server" ConnectionString="<%$ ConnectionStrings:evaConn %>"
    ProviderName="<%$ ConnectionStrings:evaConn.ProviderName %>" SelectCommand="SELECT MaHoiDong, TenHoiDong FROM HoiDong WHERE (MaDoanhNghiep = @MaDoanhNghiep) AND (Status = 1)">
    <SelectParameters>
        <asp:SessionParameter Name="MaDoanhNghiep" SessionField="CompanyID" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="dsSP" runat="server" ConnectionString="<%$ ConnectionStrings:evaConn %>"
    ProviderName="<%$ ConnectionStrings:evaConn.ProviderName %>" SelectCommand="SELECT MaSanPham, TenSanPham FROM SanPham WHERE (Status = 1) AND (MaDoanhNghiep = @MaDoanhNghiep)">
    <SelectParameters>
        <asp:SessionParameter Name="MaDoanhNghiep" SessionField="CompanyID" />
    </SelectParameters>
</asp:SqlDataSource><asp:SqlDataSource ID="dsKT_Act" runat="server" ConnectionString="<%$ ConnectionStrings:evaConn %>"
    ProviderName="<%$ ConnectionStrings:evaConn.ProviderName %>" SelectCommand="SELECT MaSanPham, MaHoiDong, Q, T, P, K2, Va, Nam FROM TieuChuanKinhTe WHERE (MaSanPham = @MaSanPham) AND (MaHoiDong = @MaHoiDong)" InsertCommand="INSERT INTO TieuChuanKinhTe(MaSanPham, MaHoiDong, Q, T, P, K2, Va, D, Nam) VALUES (@MaSanPham, @MaHoiDong, @Q, @T , @P, @K2, @Va, '', @Nam)" UpdateCommand="UPDATE TieuChuanKinhTe SET Q = @Q, T = @T , P = @P, K2 = @K2, Va = @Va, Nam = @Nam WHERE (MaHoiDong = @MaHoiDong) AND (MaSanPham = @MaSanPham)">
    <InsertParameters>
        <asp:ControlParameter ControlID="ddlSP" Name="MaSanPham" PropertyName="SelectedValue" />
        <asp:ControlParameter ControlID="ddlHD" Name="MaHoiDong" PropertyName="SelectedValue" />
        <asp:ControlParameter ControlID="txtTDT" Name="Q" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtTSLD" Name="T" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtLoiNhuan" Name="P" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtTSCD" Name="K2" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtGTGT" Name="Va" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtNam" Name="Nam" PropertyName="Text" />
    </InsertParameters>
    <UpdateParameters>
        <asp:ControlParameter ControlID="txtTDT" Name="Q" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtTSLD" Name="T" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtLoiNhuan" Name="P" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtTSCD" Name="K2" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtGTGT" Name="Va" PropertyName="Text" />
        <asp:ControlParameter ControlID="txtNam" Name="Nam" PropertyName="Text" />
        <asp:ControlParameter ControlID="ddlHD" Name="MaHoiDong" PropertyName="SelectedValue" />
        <asp:ControlParameter ControlID="ddlSP" Name="MaSanPham" PropertyName="SelectedValue" />
    </UpdateParameters>
</asp:SqlDataSource>
